Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide interface for using not at all supported alternative accounts. #1026

Merged
merged 9 commits into from
Jul 29, 2022

Conversation

kashalls
Copy link
Contributor

This provides an interface for the people desperate enough not wanting to spend money on a good game (that was until Microsoft got their grubby hands on it) to use alternative services to allow game play. I cannot heed this enough that using these alternative services may or may not get you into trouble. Do not hold me accountable.

This provides a solution for: PrismarineJS/mineflayer#1116, PrismarineJS/mineflayer#1331, PrismarineJS/mineflayer#790, #736, #1025 and a bunch more that I am not bothering to look for.

This proposal is to check if the user has specified a function for options.auth rather than mojang | microsoft. If it is a function, we let that function handle setting the username, accessToken... making any related api calls. However, when it comes to joining, if they are not using the official session server, they will have to create a local proxy to convert the expected format that usually is sent to mojang's session server to their custom auth server.

@kashalls kashalls closed this Jul 28, 2022
@kashalls kashalls reopened this Jul 28, 2022
@kashalls kashalls marked this pull request as ready for review July 28, 2022 04:02
@rom1504
Copy link
Member

rom1504 commented Jul 29, 2022

can you rebase on master

@kashalls kashalls force-pushed the prototype-alt-auth branch from 951e04f to d1d2701 Compare July 29, 2022 16:13
@rom1504 rom1504 merged commit 60379eb into PrismarineJS:master Jul 29, 2022
LucienHH added a commit to LucienHH/node-minecraft-protocol that referenced this pull request Aug 19, 2022
commit af31ece
Author: Romain Beaumont <[email protected]>
Date:   Tue Aug 16 01:00:53 2022 +0200

    Release 1.36.0

commit 79afd27
Author: IceTank <[email protected]>
Date:   Tue Aug 16 00:57:47 2022 +0200

    Fix unhandled promise rejection on ms auth (PrismarineJS#1022)

commit d7c5053
Author: extremeheat <[email protected]>
Date:   Mon Aug 15 18:57:26 2022 -0400

    1.19.0 support (PrismarineJS#1027)

    * Bump mcdata for 1.19

    * 1.19 in version.js

    * 1.19.0 in ci yml

    * Update ci.yml

    * Update version.js

    * Update package.json

    * No fail fast

    * Update mcdata

    * Update package.json

    * Update ci.yml

    * [1.19] fix tests and library session code (PrismarineJS#1020)

    * make tests work, add todo's

    * clean up, varlong test, additional todo

    * removed log statements, fix for older versions

    * Update mcdata

    * Update ci.yml

    * Update ci.yml

    * remove excessive version comments near supportFeature checks

    Co-authored-by: Romain Beaumont <[email protected]>

    * chat signing implementation

    * Update ci.yml

    * move some boilerplate to pauth

    * update tests

    * update chat example

    * bump pauth, update doc

    * modify test nextMessage func

    * lint

    * update default version

    * add server player verifyMessage

    * update doc

    Co-authored-by: Romain Beaumont <[email protected]>
    Co-authored-by: Rob9315 <[email protected]>

commit 60379eb
Author: Jordan Jones <[email protected]>
Date:   Fri Jul 29 09:41:43 2022 -0700

    Provide interface for using not at all supported alternative accounts. (PrismarineJS#1026)

    * Handle auth potentially being an function

    * "Simple" example of how in theroy it would work

    * Add package.json

    * Fix lint

    * add type declarations

    * Remove mcleaks example

    * Add doc changes

    * adjust warning

    * Fix lint from rebase manual edit.

commit e079e9b
Author: Jordan Jones <[email protected]>
Date:   Fri Jul 29 09:03:20 2022 -0700

    Use offline mode as default authentication, fallback to offline mode if invalid option. (PrismarineJS#998)

    * Default n-m-p to use offline unless specified.

    * Remove expression

    * actually make offline default

    * Revert examples

    * Revert all example changes

    * Add deprecation warning that mojang servers are no longer accepting mojang auth tokens.

commit e4c797d
Author: Romain Beaumont <[email protected]>
Date:   Fri Jul 22 22:20:55 2022 +0200

    Release 1.35.1 (PrismarineJS#1024)

    * Update HISTORY.md

    * Update package.json

commit 92fd00d
Author: Rob9315 <[email protected]>
Date:   Thu Jul 21 22:56:34 2022 +0200

    add type values to packetTest (PrismarineJS#1023)

    * add varlong value to packetTest

    * add command_node type value in packetTest

commit 446d1d9
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Jul 19 22:47:52 2022 +0200

    Bump readable-stream from 3.6.0 to 4.1.0 (PrismarineJS#1014)

    Bumps [readable-stream](https://github.com/nodejs/readable-stream) from 3.6.0 to 4.1.0.
    - [Release notes](https://github.com/nodejs/readable-stream/releases)
    - [Commits](nodejs/readable-stream@v3.6.0...v4.1.0)

    ---
    updated-dependencies:
    - dependency-name: readable-stream
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...

    Signed-off-by: dependabot[bot] <[email protected]>

    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 50de598
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Jul 19 22:47:36 2022 +0200

    Bump @types/node from 17.0.45 to 18.0.6 (PrismarineJS#1017)

    Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.45 to 18.0.6.
    - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
    - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

    ---
    updated-dependencies:
    - dependency-name: "@types/node"
      dependency-type: direct:development
      update-type: version-update:semver-major
    ...

    Signed-off-by: dependabot[bot] <[email protected]>

    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 6cc3cfc
Author: Rob9315 <[email protected]>
Date:   Tue Jul 19 22:47:18 2022 +0200

    add custom minecraft type `varlong` which aliases to varint (PrismarineJS#1018)

    * add custom minecraft type varlong which aliases to varint for now or forever

    * semicolon (standard-js)
LucienHH added a commit to LucienHH/node-minecraft-protocol that referenced this pull request Aug 19, 2022
commit af31ece
Author: Romain Beaumont <[email protected]>
Date:   Tue Aug 16 01:00:53 2022 +0200

    Release 1.36.0

commit 79afd27
Author: IceTank <[email protected]>
Date:   Tue Aug 16 00:57:47 2022 +0200

    Fix unhandled promise rejection on ms auth (PrismarineJS#1022)

commit d7c5053
Author: extremeheat <[email protected]>
Date:   Mon Aug 15 18:57:26 2022 -0400

    1.19.0 support (PrismarineJS#1027)

    * Bump mcdata for 1.19

    * 1.19 in version.js

    * 1.19.0 in ci yml

    * Update ci.yml

    * Update version.js

    * Update package.json

    * No fail fast

    * Update mcdata

    * Update package.json

    * Update ci.yml

    * [1.19] fix tests and library session code (PrismarineJS#1020)

    * make tests work, add todo's

    * clean up, varlong test, additional todo

    * removed log statements, fix for older versions

    * Update mcdata

    * Update ci.yml

    * Update ci.yml

    * remove excessive version comments near supportFeature checks

    Co-authored-by: Romain Beaumont <[email protected]>

    * chat signing implementation

    * Update ci.yml

    * move some boilerplate to pauth

    * update tests

    * update chat example

    * bump pauth, update doc

    * modify test nextMessage func

    * lint

    * update default version

    * add server player verifyMessage

    * update doc

    Co-authored-by: Romain Beaumont <[email protected]>
    Co-authored-by: Rob9315 <[email protected]>

commit 60379eb
Author: Jordan Jones <[email protected]>
Date:   Fri Jul 29 09:41:43 2022 -0700

    Provide interface for using not at all supported alternative accounts. (PrismarineJS#1026)

    * Handle auth potentially being an function

    * "Simple" example of how in theroy it would work

    * Add package.json

    * Fix lint

    * add type declarations

    * Remove mcleaks example

    * Add doc changes

    * adjust warning

    * Fix lint from rebase manual edit.

commit e079e9b
Author: Jordan Jones <[email protected]>
Date:   Fri Jul 29 09:03:20 2022 -0700

    Use offline mode as default authentication, fallback to offline mode if invalid option. (PrismarineJS#998)

    * Default n-m-p to use offline unless specified.

    * Remove expression

    * actually make offline default

    * Revert examples

    * Revert all example changes

    * Add deprecation warning that mojang servers are no longer accepting mojang auth tokens.

commit e4c797d
Author: Romain Beaumont <[email protected]>
Date:   Fri Jul 22 22:20:55 2022 +0200

    Release 1.35.1 (PrismarineJS#1024)

    * Update HISTORY.md

    * Update package.json

commit 92fd00d
Author: Rob9315 <[email protected]>
Date:   Thu Jul 21 22:56:34 2022 +0200

    add type values to packetTest (PrismarineJS#1023)

    * add varlong value to packetTest

    * add command_node type value in packetTest

commit 446d1d9
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Jul 19 22:47:52 2022 +0200

    Bump readable-stream from 3.6.0 to 4.1.0 (PrismarineJS#1014)

    Bumps [readable-stream](https://github.com/nodejs/readable-stream) from 3.6.0 to 4.1.0.
    - [Release notes](https://github.com/nodejs/readable-stream/releases)
    - [Commits](nodejs/readable-stream@v3.6.0...v4.1.0)

    ---
    updated-dependencies:
    - dependency-name: readable-stream
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...

    Signed-off-by: dependabot[bot] <[email protected]>

    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 50de598
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Jul 19 22:47:36 2022 +0200

    Bump @types/node from 17.0.45 to 18.0.6 (PrismarineJS#1017)

    Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.45 to 18.0.6.
    - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
    - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

    ---
    updated-dependencies:
    - dependency-name: "@types/node"
      dependency-type: direct:development
      update-type: version-update:semver-major
    ...

    Signed-off-by: dependabot[bot] <[email protected]>

    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 6cc3cfc
Author: Rob9315 <[email protected]>
Date:   Tue Jul 19 22:47:18 2022 +0200

    add custom minecraft type `varlong` which aliases to varint (PrismarineJS#1018)

    * add custom minecraft type varlong which aliases to varint for now or forever

    * semicolon (standard-js)
LucienHH added a commit to LucienHH/node-minecraft-protocol that referenced this pull request Jan 15, 2023
commit af31ece
Author: Romain Beaumont <[email protected]>
Date:   Tue Aug 16 01:00:53 2022 +0200

    Release 1.36.0

commit 79afd27
Author: IceTank <[email protected]>
Date:   Tue Aug 16 00:57:47 2022 +0200

    Fix unhandled promise rejection on ms auth (PrismarineJS#1022)

commit d7c5053
Author: extremeheat <[email protected]>
Date:   Mon Aug 15 18:57:26 2022 -0400

    1.19.0 support (PrismarineJS#1027)

    * Bump mcdata for 1.19

    * 1.19 in version.js

    * 1.19.0 in ci yml

    * Update ci.yml

    * Update version.js

    * Update package.json

    * No fail fast

    * Update mcdata

    * Update package.json

    * Update ci.yml

    * [1.19] fix tests and library session code (PrismarineJS#1020)

    * make tests work, add todo's

    * clean up, varlong test, additional todo

    * removed log statements, fix for older versions

    * Update mcdata

    * Update ci.yml

    * Update ci.yml

    * remove excessive version comments near supportFeature checks

    Co-authored-by: Romain Beaumont <[email protected]>

    * chat signing implementation

    * Update ci.yml

    * move some boilerplate to pauth

    * update tests

    * update chat example

    * bump pauth, update doc

    * modify test nextMessage func

    * lint

    * update default version

    * add server player verifyMessage

    * update doc

    Co-authored-by: Romain Beaumont <[email protected]>
    Co-authored-by: Rob9315 <[email protected]>

commit 60379eb
Author: Jordan Jones <[email protected]>
Date:   Fri Jul 29 09:41:43 2022 -0700

    Provide interface for using not at all supported alternative accounts. (PrismarineJS#1026)

    * Handle auth potentially being an function

    * "Simple" example of how in theroy it would work

    * Add package.json

    * Fix lint

    * add type declarations

    * Remove mcleaks example

    * Add doc changes

    * adjust warning

    * Fix lint from rebase manual edit.

commit e079e9b
Author: Jordan Jones <[email protected]>
Date:   Fri Jul 29 09:03:20 2022 -0700

    Use offline mode as default authentication, fallback to offline mode if invalid option. (PrismarineJS#998)

    * Default n-m-p to use offline unless specified.

    * Remove expression

    * actually make offline default

    * Revert examples

    * Revert all example changes

    * Add deprecation warning that mojang servers are no longer accepting mojang auth tokens.

commit e4c797d
Author: Romain Beaumont <[email protected]>
Date:   Fri Jul 22 22:20:55 2022 +0200

    Release 1.35.1 (PrismarineJS#1024)

    * Update HISTORY.md

    * Update package.json

commit 92fd00d
Author: Rob9315 <[email protected]>
Date:   Thu Jul 21 22:56:34 2022 +0200

    add type values to packetTest (PrismarineJS#1023)

    * add varlong value to packetTest

    * add command_node type value in packetTest

commit 446d1d9
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Jul 19 22:47:52 2022 +0200

    Bump readable-stream from 3.6.0 to 4.1.0 (PrismarineJS#1014)

    Bumps [readable-stream](https://github.com/nodejs/readable-stream) from 3.6.0 to 4.1.0.
    - [Release notes](https://github.com/nodejs/readable-stream/releases)
    - [Commits](nodejs/readable-stream@v3.6.0...v4.1.0)

    ---
    updated-dependencies:
    - dependency-name: readable-stream
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...

    Signed-off-by: dependabot[bot] <[email protected]>

    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 50de598
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Jul 19 22:47:36 2022 +0200

    Bump @types/node from 17.0.45 to 18.0.6 (PrismarineJS#1017)

    Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.45 to 18.0.6.
    - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
    - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

    ---
    updated-dependencies:
    - dependency-name: "@types/node"
      dependency-type: direct:development
      update-type: version-update:semver-major
    ...

    Signed-off-by: dependabot[bot] <[email protected]>

    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 6cc3cfc
Author: Rob9315 <[email protected]>
Date:   Tue Jul 19 22:47:18 2022 +0200

    add custom minecraft type `varlong` which aliases to varint (PrismarineJS#1018)

    * add custom minecraft type varlong which aliases to varint for now or forever

    * semicolon (standard-js)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants